#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
const int maxn = 3e5+10;
int a[maxn];
int b[maxn];
int main()
{
	int t;
	cin>>t;
	while(t--)
	{
		int flagu = 0,flagd = 0;
		int n;
		cin>>n;
		for(int i = 0;i<n;i++)
		{
			cin>>a[i];
		}
		for(int i = 1;i<n;i++)
		{
			if(a[i]>a[i-1]) flagd = 1;
			if(a[i]<a[i-1]) flagu = 1;
		}
		if(flagu+flagd==1) printf("YES\n");
		else 
		{
			flagu = 0;
			flagd = 0;
			for(int i = 0;i<n;i++)
			{
				if(i==0) a[i] = i;
				else 
				{
					if(a[i]>a[i-1]&&!flagu) a[i] = a[i-1]+1;
					else 
					{
						flagu = 1;
					}
					if(a[i]>=a[i-1]&&flagu) a[i] = a[i-1]-1;
					if(a[i]<0)
					{
						flagd = 1;
						break;
					}
				}		
			}
			if(flagd) printf("NO\n");
			else printf("YES\n");
		}
	}
}
